package com.example.Configuration;

import com.example.model.User;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

@Configuration
public class BeanConfig {

    @Bean
    public User user1() { // Bean名称将是 "user1"
        User user = new User();
        user.setName("zhangsan");
        user.setAge(18);
        return user;
    }

    @Bean
    public User user2() { // Bean名称将是 "user2"
        User user = new User();
        user.setName("lisi");
        user.setAge(19);
        return user;
    }
}